using System;
using DotNetNuke;
using System.Data;

using DotNetNuke.Framework;

namespace Jfc.DnnMarketingTools.MemberInvite
{
    /// -----------------------------------------------------------------------------
    /// <summary>
    /// An abstract class that provides the DAL contract
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <history>
    /// </history>
    /// -----------------------------------------------------------------------------
    public abstract class DataProvider
    {

    #region Shared/Static Methods

        // singleton reference to the instantiated object 
        static DataProvider  objProvider = null;

        // constructor
        static DataProvider()
        {
            CreateProvider();
        }

        // dynamically create provider
        private static void CreateProvider()
        {
            objProvider = (DataProvider)Reflection.CreateObject("data", "Jfc.DnnMarketingTools.MemberInvite", "");
        }

        // return the provider
        public static  DataProvider Instance() 
        {
            return objProvider;
        }

    #endregion

    #region Abstract methods

        public abstract void AddMemberInvite(int PortalId, Guid InviteGuid, string FirstName, string LastName, string Email, string Subject, string Body, int UserId, int Status);
        public abstract IDataReader GetMemberInvite(int InviteId, int PortalId);
        public abstract IDataReader GetMemberInviteByGuid(Guid InviteGuid);
        public abstract IDataReader GetMemberInvites(int PortalId);
        public abstract IDataReader GetMemberInvitesForUser(int PortalId, int UserId);
        public abstract void UpdateMemberInvite(int InviteId, int PortalId, Guid InviteGuid, string FirstName, string LastName, string Email, string Subject, string Body, int UserId, int Status, DateTime StatusDate);
        public abstract void DeleteMemberInvite(int InviteId, int PortalId);

        public abstract IDataReader GetMemberInviteSettings(int PortalId, int UserId);
        public abstract void SetMemberInviteSettings(int PortalId, int UserId, string SubjectTemplate, string BodyTemplate);
    #endregion
    
    }
}
